package com.bcu.alumnus.repo;

import com.bcu.alumnus.entity.Moment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MomentRepository extends JpaRepository<Moment,Integer> {


    Moment getMomentByMomentId(int momentId);

    @Modifying
    int deleteMomentByMomentId(int momentId);



    @Query(value = "UPDATE Moment set momentStatus=1 where momentId=?1")
    @Modifying
    int UpDateMomentStatusByMomentId(int momentId);

    @Override
    List<Moment> findAll();


}
